﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class main_web : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
    }

    protected void btnLogin_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            string username = txtUsername.Text.Trim();
            string password = txtPassword.Text.Trim();

            // 示例：简单的用户名和密码验证
            if (username == "admin" && password == "123456")
            {
                Response.Write("<script>alert('登录成功！');</script>");
            }
            else
            {
                Response.Write("<script>alert('用户名或密码错误！');</script>");
            }
        }
    }
}